package com.panshi.api;

import com.panshi.vo.R;
import com.panshi.vo.SysUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
@FeignClient(value = "hasbei-sys.com",path = "/api/sys/user")
public interface SysUserApi {

    @GetMapping("/list")
    List<SysUserVO> listSysUser();

    //分页查询系统用户列表
    @GetMapping("/pageUserList/{page}/{limit}")
    R pageUserList(@PathVariable("page") Integer page , @PathVariable("limit") Integer limit);

    @PostMapping
    R saveSysUser(@Validated @RequestBody SysUserVO sysUser);

    @PutMapping
    R updateSysUser(@Validated @RequestBody SysUserVO sysUser);


    @DeleteMapping("/{id}")
    R deleteSysUser(@PathVariable("id")Integer id);

    @GetMapping("/{username}")
    SysUserVO getByUsername(@PathVariable("username")String username);
}
